#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2018/11/8 17:35
# @Author  : youfeng

import re

from base_upload import BaseUpload


class BasicUpload(BaseUpload):
    __REMOTE_BASE_PATH = '/ZSTP/basic_data'

    def __init__(self, data_path, log):
        super(BasicUpload, self).__init__(data_path, log)

    def get_remote_path(self, file_name):
        search_list = re.findall("data_parsed_(.*?)_.*?$", file_name)
        if len(search_list) <= 0:
            return None

        return "{}/{}".format(self.__REMOTE_BASE_PATH, search_list[0])
